From bcfb1fd1662bcb341aec1ef43601f4464d6a9819 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Thu, 24 Apr 2008 21:09:27 +0000 Subject: [PATCH] dg100: Speed is in kilometers per hour. Add patch from Eike and Mirko. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3207 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/dg-100.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gpsbabel/dg-100.c b/gpsbabel/dg-100.c index 6b6942506..051857858 100644 --- a/gpsbabel/dg-100.c +++ b/gpsbabel/dg-100.c @@ -246,7 +246,11 @@ process_gpsfile(gbuint8 data[], route_head *track) bintime = be_read32(data + i + 8); bindate = be_read32(data + i + 12); wpt->creation_time = bintime2utc(bindate, bintime); - wpt->speed = be_read32(data + i + 16) / 100.0; + /* The device presents the speed as a fixed-point number + * with a scaling factor of 100, in km/h. + * The waypoint struct wants the speed as a + * floating-point number, in m/s. */ + wpt->speed = KPH_TO_MPS(be_read32(data + i + 16) / 100.0); wpt->wpt_flags.speed = 1; } -- 2.30.2